package com.quwan.manager.controller;

import com.quwan.common.BaseController;
import com.quwan.common.result.ApiResult;
import com.quwan.common.result.PageResult;
import com.quwan.entity.TSecurityAuditLog;
import com.quwan.manager.service.SecurityAuditLogService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author laozhang
 * @date 2022/1/4 17:24
 */
@Api(tags = "后台安全审计日志管理接口")
@RestController
@RequiredArgsConstructor
@RequestMapping("mgr/security")
public class SecurityAuditLogController extends BaseController {

    private final SecurityAuditLogService securityAuditLogService;

    @ApiOperation(value = "用户日志列表", notes = "<span style=\"color:red\">注意参数是否必填</span>", httpMethod = "POST")
    @PostMapping("securityLogListPage")
    public ApiResult<PageResult<TSecurityAuditLog>> SecurityAuditLogListPage(@RequestParam(defaultValue = "1") int page,
                                                                             @RequestParam(defaultValue = "10") int size,
                                                                             @ApiParam(value = "接口类型:1-发单，2-发动态，3-发布技能") @RequestParam(required = false) Integer type,
                                                                             @ApiParam(value = "电话号码") @RequestParam(required = false) String mobile,
                                                                             @ApiParam(value = "用户id") @RequestParam(required = false) String id) {
        PageResult<TSecurityAuditLog> res = securityAuditLogService.getSecurityAuditLogListPage(page, size, type, mobile,id);
        return ApiResult.success(res);
    }
}
